package spe.ui.editor.part;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.editparts.AbstractTreeEditPart;

import spe.model.notation.SPEMDiagram;
import spe.model.spem.MethodPlugin;
import spe.model.spem.NodeElement;
import spe.model.spem.SPEMElement;

public class SPEOutlineEditPartFactory implements EditPartFactory
{

	@Override
	public EditPart createEditPart(EditPart arg0, Object model) 
	{
		if (model instanceof AbstractTreeEditPart)
			return (EditPart)model;
		
		if(model instanceof SPEMDiagram)
		{
			//System.out.println(String.format("[SPEOutlineEditPartFactory] model: %s", model));
			return new DiagramOutlineEditPart((SPEMElement) model);
		}
		
		if(model instanceof NodeElement)
			return new OutlineEditPart((SPEMElement) model){};
		
		return null;
	}

}
